package com.atguigu.petstore.coupon.rpc;

import com.atguigu.petstore.common.result.Result;
import com.atguigu.petstore.coupon.service.CouponInfoService;
import com.atguigu.petstore.coupon.vo.SeckillProductVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author lfy
 * @Description
 * @create 2023-09-28 13:51
 */
@Tag(name = "优惠RPC")
@RequestMapping("/rpc/coupon")
@RestController
public class CouponRpcController {

    @Autowired
    CouponInfoService couponInfoService;

    @Operation(summary = "获取秒杀商品列表")
    @GetMapping("/seckill/products")
    public Result<List<SeckillProductVo>> getSeckillProduct(){

        List<SeckillProductVo> vos = couponInfoService.getSeckillProduct();

        return Result.ok(vos);
    }
}
